project('libsimple', 'cpp')

boost_dep = dependency('boost', modules : ['thread',  'filesystem', 'type_erasure'] , required: true)

spdlog_dep = subproject('spdlog').get_variable('spdlog_dep')
if not spdlog_dep.found()
    opencv_dep = dependency('spdlog',  required: true)
endif 


dep_list = [spdlog_dep, boost_dep]
src_list = ['simple.cpp']

cpp_args = ['-Wno-unused-variable','-Wno-unused-value','-Wno-unused-const-variable','-Wno-unused-parameter', '-Wno-sign-compare','-Wno-deprecated-declarations' , '-Wno-pedantic' ,  '-Wno-return-type' ,'-Wno-unused-parameter' , '-Wno-reorder' ,'-Wno-pedantic' ,'-Wno-unused-function' ,'-Wno-non-virtual-dtor','-Wno-unused-result']

inc = include_directories('.')
libsimple = shared_library(
    'simple',
    src_list,
    cpp_args: cpp_args,
    dependencies: dep_list,
    include_directories : inc,
    install : true
)

libsimple_dep = declare_dependency(include_directories : inc,
  link_with : libsimple)

test = executable('lib_test',
	['test.cpp'],
	cpp_args : cpp_args,
	include_directories: inc,
	dependencies : dep_list,
	link_with : [libsimple]
)

e = environment()
e.set('SPDLOG_LEVEL', 'debug')

test('test',
	test,
	env: e, 
	timeout: -1
)
